package com.cec.controller.admin;


import com.cec.service.admin.FeedbackService;
import com.cec.dto.FeedbackDTO;
import com.cec.result.Result;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 反馈表 前端控制器
 * </p>
 *
 * @author lt
 * @since 2024-10-25
 */
@Slf4j
@RestController
@RequestMapping("/admin/feedback")
public class FeedbackController {

    @Autowired
    private FeedbackService feedbackService;
    @GetMapping
    @ApiOperation("分页查询反馈列表")
    public Result pageQueryFeedback(FeedbackDTO feedbackDTO) {
        log.info("feedbackDTO:{}", feedbackDTO);
        return feedbackService.pageQueryFeedbackList(feedbackDTO);
    }

    @DeleteMapping("/logicDel/{id}")
    @ApiOperation("逻辑删除意见反馈信息")
    public Result logicDeleteActivityById(@PathVariable Integer id){
        log.info("id-->{}",id);
        return feedbackService.logicDeleteFeedbackById(id);
    }

    @DeleteMapping("/logicBatchDel")
    @ApiOperation("逻辑批量删除意见反馈信息")
    public Result logicBatchDeleteActivityByIds(@RequestBody List<Integer> ids){
        log.info("id-->{}",ids);
        return feedbackService.logicBatchDeleteFeedbackByIds(ids);
    }
}

